function main(params){
    let state = params['88a99154-7978-4e46-8b1c-2393d6b7131c'];
    let flag = false;
    if (state === '审核不通过') {
        flag = true;
    }
    return flag;
}

function main(params) {
    const self = this;

    let documentNo = params.verify_id.value
    let applyTypeIdValue = 2;
    let objectId = params.holder_id.value;

    getVerifyRecord(objectId, applyTypeIdValue).then(res => {
        let length = res.result.length;
        let pageId = '';
        if (length > 0) {
            pageId = '1960166689527746560'
            openDetail(self, pageId, objectId, applyTypeIdValue, documentNo);
        } else {
            pageId = '1959905877378650112'
            openDetail(self, pageId, objectId, applyTypeIdValue, documentNo);
        }
    })
}

/**
 * 获取场所申请是否有待审核或审核通过的记录
 * stall_organization_id
 * verify_state_id = 1 or 0
 */
function getVerifyRecord(objectId, applyTypeIdValue) {
    const params = [{
        name: "applyTypeId",
        valueContent: applyTypeIdValue
    }, {
        name: "objectId",
        valueContent: objectId
    }];

    return new Promise((resolve, reject) => {
        api.DATA_SOURCE_EXECUTE("ds_mod:02bf32cc-f924-4c1e-81ef-2dbf186be1aa", "ddcat", params, [], "").then(res => {
            resolve(res)
        });
    })


}


/**
 * 打开详情页面
 * @param self
 * @param pageId
 * @param objectId
 * @param applyTypeId
 * @param documentNo
 */
function openDetail(self, pageId, objectId, applyTypeId, documentNo) {
    self.$router.push({
        name: "page-preview",
        query: {
            title: "详情",
            pageId: pageId,
            objectId: objectId,
            applyTypeId: applyTypeId,
            documentNo: documentNo,
            showHeader: self.$route.query.showHeader,
            pageTitle: "查看详情",
            linkTitle: '查看详情',
            showBackHeade: true,
            isFromAction: 1,
            _t: new Date().getTime() + ""
        }
    });
}
